package com.frh.demo.controller;

import com.frh.demo.pojo.User;
import com.frh.demo.service.impl.UserServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
public class HelloController {

    @Autowired
    private UserServiceImpl userServiceImpl;

    @RequestMapping("/")
    public String hello() {
        List<User> users = userServiceImpl.getAllUsers();
        for(User user:users) {
            System.out.println(user.getId() + user.getName() + user.getAge());
        }
        System.out.println("Hello 1 2 3");
        return "Hello Spring-Boot";
    }
}
